package com.darker.yygh.controller;

import com.atguigu.yygh.vo.hosp.DepartmentQueryVo;
import com.atguigu.yygh.vo.hosp.DepartmentVo;
import com.darker.yygh.result.Result;
import com.darker.yygh.service.DepartmentService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
//@CrossOrigin
@RestController
@RequestMapping("/admin/hosp/department")
public class DepartmentController {
    @Autowired
    DepartmentService departmentService;

    //根据医院编号 查询医院所有科室
    @ApiOperation("查询医院所有科室")
    @GetMapping("/getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode){
        List<DepartmentVo> departmentQueryVoList=departmentService.findDeptTree(hoscode);
        return Result.ok(departmentQueryVoList);
    }

}
